
import java.util.HashMap;
import java.util.Map;

import javax.xml.namespace.QName;

import org.apache.muse.core.proxy.ProxyHandler;
import org.apache.muse.core.proxy.ReflectionProxyHandler;
import org.w3c.dom.Element;


public class ResouceConstants {

	public static final Map _HANDLERS_BY_NAME = new HashMap();

	public static final String[] _METHOD_NAMES = {
		"getResourcePropertyDocument", "getMetadata"
	};

	public static final Class[] _RETURN_TYPES = {
		Element.class, Element.class
	};

	public static final String[] _ACTIONS = {
		"http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentRequest",
		"http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata"
	};

	public static final QName[] _REQUEST_NAMES = {
		new QName("http://docs.oasis-open.org/wsrf/rp-2", "GetResourcePropertyDocument", "pfx6"),
		new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "GetMetadata", "pfx7")
	};

	public static final QName[] _RESPONSE_NAMES = {
		new QName("http://docs.oasis-open.org/wsrf/rp-2", "GetResourcePropertyDocumentResponse", "pfx6"),
		new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata", "pfx7")
	};

	public static final QName[][] _REQUEST_PARAM_NAMES = {
		{
		},
		{
			new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Dialect", "pfx7"),
			new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Identifier", "pfx7")
		}
	};
	
	public static ProxyHandler getHandler(String methodName)
	{
		return (ProxyHandler)_HANDLERS_BY_NAME.get(methodName);
	}

	static
	{
		for (int n = 0; n < _METHOD_NAMES.length; ++n)
		{
			ProxyHandler handler = new ReflectionProxyHandler();
			handler.setAction(_ACTIONS[n]);
			handler.setRequestName(_REQUEST_NAMES[n]);
			handler.setRequestParameterNames(_REQUEST_PARAM_NAMES[n]);
			handler.setResponseName(_RESPONSE_NAMES[n]);
			handler.setReturnType(_RETURN_TYPES[n]);

			_HANDLERS_BY_NAME.put(_METHOD_NAMES[n], handler);
		}
	}
}
